{include file="common/header" title="用户列表"}
<div class="layui-body">
	<!-- 内容主体区域 -->

	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
		<legend>生成权限节点</legend>
	</fieldset>
	<div style="padding: 30px;">
		<form class="layui-form" action="" style="max-width: 1000px;width: 90%;">

			<div class="layui-form-item">
				<label class="layui-form-label">菜单</label>
				<div class="layui-input-inline">
					<input type="text" name="menu_rules" required lay-verify="required" placeholder="/admin/控制器/方法"
						autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item" pane="">
				<label class="layui-form-label">节点</label>
				<div class="layui-input-block" class="layui-row layui-col-space1">
					<div class="layui-col-md3">
						<input type="checkbox" name="rule[]" lay-skin="primary" value='添加:add' title="添加:add" checked="">
					</div>
					<div class="layui-col-md3">
						<input type="checkbox" name="rule[]" lay-skin="primary" value='删除:delete' title="删除:delete" checked="">
					</div>
					<div class="layui-col-md3">
						<input type="checkbox" name="rule[]" lay-skin="primary" value='编辑:edit' title="编辑:edit" checked="">
					</div>
					
				</div> 
			</div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit lay-filter="addBtn">生成权限节点</button>
				</div>
			</div>
		</form>
	</div>
</div>
<script>
	layui.use(['layer', 'form'], function () {
		var layer = layui.layer;
		var $ = layui.jquery;
		var form = layui.form;

		//监听提交
		form.on('submit(addBtn)', function(data) {
			$.post('', data.field, function(rs) {
				if (rs.code == 1) {
					layer.alert(rs.msg)
				} else {
					layer.alert(rs.msg)
				}
			})
			return false;
		});
	});
</script>
{include file="common/footer"}